package com.tiny.cqzcp.service.impl;

import com.tiny.cqzcp.dao.JobDao;
import com.tiny.cqzcp.pojo.Job;
import com.tiny.cqzcp.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA
 * DateTime: 2021/2/19 10:43
 *
 * @Author: jmz
 */
@Service
public class JobServiceImpl implements JobService {

    private JobDao jobDao;

    @Autowired
    public JobServiceImpl(JobDao jobDao){
        this.jobDao = jobDao;
    }

    @Override
    public Job queryJobByType(Integer type) {
        return jobDao.selectByPrimaryKey(type);
    }

    @Override
    public int updateRecord(Job record) {
        return jobDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int addRecord(Job record) {
        return jobDao.insert(record);
    }

    @Override
    public int deleteRecord(Integer type) {
        return jobDao.deleteByPrimaryKey(type);
    }
}
